Skip to content

Conversation

@scholzp
Copy link
Contributor

@scholzp scholzp commented Nov 27, 2025

This test adds checks for verifying correct BDF assignment through libvirt and that CHV respects those assignments, even after live migration. Moreover, this test ensures that BDFs can be freed and reused when de-/attaching devices (might be more of a theoretical feature?).

For further details, see the test description.

Related to https://github.com/cobaltcore-dev/cobaltcore/issues/287.

@scholzp scholzp self-assigned this Nov 27, 2025
Copy link
Member

@phip1611 phip1611 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally great work! Left a few remarks

@scholzp scholzp force-pushed the bdf_tests branch 3 times, most recently from b23fb51 to 4aac2f1 Compare November 27, 2025 17:17
@tpressure
Copy link
Contributor

tpressure commented Nov 27, 2025

This is great work, can we also add 2 hotplug devices:

  • 1 network dev with specific bdf
  • 1 disk with dev specific bdf?

Copy link
Collaborator

@hertrste hertrste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We well written test case 👍

Copy link
Member

@phip1611 phip1611 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the direction into that we are going here - good work! I left a few remarks

@scholzp scholzp force-pushed the bdf_tests branch 6 times, most recently from 8089e2d to 9b27e1b Compare December 5, 2025 07:54
Copy link
Member

@phip1611 phip1611 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I left a few remarks. I'm already approving.

@phip1611
Copy link
Member

phip1611 commented Dec 5, 2025

You need to rebase your PR.

@scholzp scholzp force-pushed the bdf_tests branch 3 times, most recently from 240f603 to 8654c40 Compare December 5, 2025 14:07
@scholzp
Copy link
Contributor Author

scholzp commented Dec 12, 2025

I just added negative tests for:

  • libvirt receives an invalid device ID in a BDF
  • libvirt receives a function ID in a BDF

Both are expected to be blocked and errrored upon by libvirt.

@phip1611
Copy link
Member

Great work!

@scholzp scholzp force-pushed the bdf_tests branch 4 times, most recently from fd15760 to d955b3c Compare January 7, 2026 09:38
@scholzp scholzp force-pushed the bdf_tests branch 2 times, most recently from 5fe94a9 to 2c91b5d Compare January 8, 2026 12:44
Copy link
Member

@phip1611 phip1611 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 🔥

@scholzp scholzp force-pushed the bdf_tests branch 2 times, most recently from c5ea19f to 7783a75 Compare January 8, 2026 14:22
We need to specify slot IDs in the XML from which the VM config for CHV
is created. This is in preparation for testing BDF fixing.

Signed-off-by: Pascal Scholz <[email protected]>
On-behalf-of: SAP [email protected]
When evaluating PCI BDF assignment we need a way to query these
information from a test VM. This commit adds a handy way to obtain all
BDFs with their assigned devices.

Signed-off-by: Pascal Scholz <[email protected]>
On-behalf-of: SAP [email protected]
The added tests checks that libvirt and CHV assigned and propagate PCI
BDF correctly to the guest's PCI devices. It furthermore ensures, that
these assignment stay valid even after live migration.

Signed-off-by: Pascal Scholz <[email protected]>
On-behalf-of: SAP [email protected]
We test that a VM, after recreation, assignes the same BDFs to it
devices, even if we transiently remove a device before shutting the VM
down.

Signed-off-by: Pascal Scholz <[email protected]>
On-behalf-of: SAP [email protected]
We test that the persistent config stores the correct BDF.

Signed-off-by: Pascal Scholz <[email protected]>
On-behalf-of: SAP [email protected]
We need to test that an invalid BDF results in an error from libvirt
and does not crash CHV.

Signed-off-by: Pascal Scholz <[email protected]>
On-behalf-of: SAP [email protected]
We need a negative test that shows, that adding a function ID when
entering a BDF result in libvirt generating a failure and CHV not
crashing.

Signed-off-by: Pascal Scholz <[email protected]>
On-behalf-of: SAP [email protected]
@scholzp scholzp added this pull request to the merge queue Jan 8, 2026
Merged via the queue into cyberus-technology:main with commit c490f12 Jan 8, 2026
3 checks passed
@scholzp scholzp deleted the bdf_tests branch January 8, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants